﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="废品判定通知书.aspx.cs" Inherits="syc.ZhiJian.废品判定通知书" %>

<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.SqlClient" %>
<%@ Import Namespace="System.Configuration" %>
<html>
<head>
<title></title>
<style>
a.listitem{display:block;border-top:1px solid #eeeeee;padding:2px;}
a.listitem:link {color: #333333;text-decoration: none; }
a.listitem:visited {color: #333333;text-decoration: none; }
a.listitem:hover {color: #ff9966;text-decoration: none; background-color:#d2e8ae; }
a.listitem:active {color: #ff9966;text-decoration: none; }

a.edit{display:block;height:23px;line-height:23px;}
a.edit:link {color: #333333;text-decoration: none; }
a.edit:visited {color: #333333;text-decoration: none; }
a.edit:hover {color: #6666ff;text-decoration: none; background-color:#d2e8ae; }
a.edit:active {color: #6666ff;text-decoration: none; background-color:#d2e8ae; }

</style>
</head>
<body>
<script runat="server">
    protected string 品名ID;
    protected string 品名;
    protected string 钢级;
    protected string 规格;
    protected string 支数;
    protected string 供货商;
    protected string 炉号;
    protected bool 判定;
    protected string 判定日期;
    protected string 原因;
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!this.IsPostBack)
        {            
            品名ID = Request.QueryString["pm"];
            支数 = Request.QueryString["zs"];
            供货商 = Request.QueryString["ghs"];
            炉号 = Request.QueryString["lh"];
            判定 = true;
            判定日期 = DateTime.Today.ToString();            
            原因 = Request.QueryString["yy"].Substring(0,1);
            if (判定日期 ==""||判定日期 ==null)
            {
                判定日期 = "";
            }
            else
            {
                判定日期 = DateTime.Parse(判定日期).ToString("yyyy年MM月dd日");
            }
            if (品名ID =="1")
            {
                钢级 = "J55";
                规格="88.9*12.5";
                品名 = "油接箍钢管";
            }
             if (品名ID =="2")
            {
                钢级 = "J55";
                规格="153.67*13";
                品名 = "套接箍钢管"; 
            }
            if (品名ID == "3")
            {
                钢级 = "N80Q";
                规格="88.9*12.5";
                品名 = "油接箍钢管";
            }
              if (品名ID == "3")
            {
                钢级 = "N80Q";
                规格 = "153.67*13";
                品名 = "套接箍钢管"; 
            }

              if (判定 == true)
              {
                  PDZ.Visible = true;
              }
              else
              {
                  PDZ.Visible = false;
              }
             
        }
            

    }



</script>
<script type="text/javascript" language="javascript" src="/common.js"></script>
<form id="form1" runat="server" onsubmit="return(checkInput())">

<asp:SqlDataSource ID="SqlDataSource1" runat="server" 
    ConnectionString="<%$ ConnectionStrings:SCMConnectionString1 %>" 
    SelectCommand="SELECT [ID], [名称] FROM [原料供货单位]" 
   >
    
</asp:SqlDataSource>
<div id="GHList" style="display:none; position:absolute;top:207px;left:160px; border:3px solid #ffcc00;width:120px; height:239px; overflow-y:scroll;background-color:#ffffff;">
<a class=listitem href="javascript:" onclick="setGH(-1,'');">---清空---</a>
<asp:Repeater ID="GongHuo" runat="server" DataSourceID="SqlDataSource1">
<ItemTemplate>
<a id='ghid_<%# Eval("ID")%>' class=listitem href="javascript:" onclick='setGH(this.id,this.innerHTML);'><%# Eval("名称")%></a>
</ItemTemplate>
</asp:Repeater>
</div>

<div id="wintop" class="wintop">废品判定通知书</div>
<asp:Panel ID="Panel1" runat="server" CssClass="panel">

    <asp:Button ID="Button_PanDin" runat="server" Text="盖 章" CssClass="button" 
        UseSubmitBehavior="False" Visible="false"  />

    <input type="button" value="导出Excel" class="button" onclick="Export();" style="font-weight:normal" />

    <input type="button" value="关 闭" class="button" onclick="parent.swin2_close();" />
    

</asp:Panel>

<script>    putBillHead();</script>

<asp:Panel ID="Panel3" runat="server">
<style>
td{text-align:center;}
td.pane{border:.5pt solid #000000;}
div.edit{overflow:hidden; white-space:nowrap;}
</style>
<table border=0 cellpadding=0 style=border-collapse:collapse;text-align:center;font-size:11pt;>
  <tr height=28>
    <td colspan=8 style=font-size:24px;font-weight:bold;> 废品判定通知书</td>
  </tr>
  <tr height=24>
    <td colspan=8 style=padding-right:10px;text-align:right;>编号：SYC/ZJ-JZ-79</td>
  </tr>
  <tr height=28>
    <td width=80 class=pane>钢 级</td>
    <td width=70 class=pane><%=钢级 %></td>
    <td width=100 class=pane>规 格(mm)</td>
    <td width=100 class=pane><%=规格 %></td>
    <td width=110 class=pane>供货商</td>
    <td colspan="3" class=pane ><%=供货商%></td>
  </tr>
  <tr height=28>
    <td class=pane>支 数</td>
    <td class=pane><%=支数 %></td>
    <td class=pane>坯料重量(kg)</td>
    <%if (品名ID == "1" || 品名ID == "3")
      { %>
    <td class=pane><%=double.Parse(支数)*3.2 %></td>
    <%}
      else if (品名ID == "2" || 品名ID == "4")
      { %>
    <td class=pane><%=double.Parse(支数)*10 %></td>      
    <%} %>
    <td class=pane>炉号/批号</td>
    <td width="100" class=pane><%=炉号%></td>
    <td width="70" class=pane>检验标准</td>
    <td width="100" class=pane><span style="padding-right:10px;text-align:right;">Q/syc18-2010</span></td>
  </tr>
   <tr height=180>
    <td class=pane>不合格原因</td>   
    <% 
        if (原因 == "磁")
       {%>
    <td class=pane colspan="7" align="left"><div contentEditable ><%=DateTime.Today.Month %>月份<%=供货商 %>所供<%=品名 %>螺纹加工后,经磁粉探伤检验,外表存在裂纹缺陷。</div></td>
    <%}
       else
       { %>
     <td class=pane colspan="7" align="left"><div contentEditable ><%=DateTime.Today.Month %>月份<%=供货商 %>所供<%=品名 %>螺纹加工中出现齿高、紧密距等缺陷。</div></td>
    <%} %>
  </tr>
  <tr height=28>
    <td class=pane>判定结果</td>
    <% 
        if (判定 == false)
      { %>
        <td class=pane>待判定</td>
    <%}
      else
      { %>
      <td class=pane>废品</td>
    <%} %>    
    <td class=pane>责任单位</td>
    <td class=pane>供应处</td>
    <td class=pane>判定员</td>
    <% if (判定 == true)
       {
           string op = (string)this.Session["OperatorName"];
     %>
       <td width="100" class=pane><%=op%></td> 
    <%}
       else
       {%>
       <td width="100" class=pane></td>
     <%} %>
    <td  class=pane>日 期</td>
    <td  class=pane ><span style="padding-left:2px;text-align:center; font-size:9pt"><%=判定日期%></span></td>
  </tr>
  <tr height=40>
    <td class=pane>备 注</td>
      <% 
        if (原因 == "磁")
       {%>
    <td class=pane colspan="7">该废品属于原材料表面质量问题</td>
     <%}
     %>
    <td class=pane colspan="7"></td>
  </tr>
</table>
</asp:Panel>
<div style="text-align:right;height:105px;margin-top:-95px;margin-right:20px;">
<asp:Image ID="PDZ" runat="server" ImageUrl="/images/pdz.png" Visible="false" />
</div>
<script>    putBillFoot();</script>

</form>

<form id="form2" method="post" action="/PageExport.ashx">
<input type="hidden" name="filename" value="废品判定通知书.xls" />
<input type="hidden" name="content" value="" />
</form>


<script>
var notice = '<%=this.Notice %>';
if (notice != '') {
    parent.showmsgbox(notice);
}

//导出Excel
function Export() {
    form2.content.value =
"<html xmlns:o='urn:schemas-microsoft-com:office:office'\nxmlns:x='urn:schemas-microsoft-com:office:excel'\nxmlns='http://www.w3.org/TR/REC-html40'>\n<head>\n<meta http-equiv=Content-Type content='text/html; charset=utf-8'>\n<style>\n<!--table\n@page\n{mso-header-data:;\nmso-footer-data:;\nmargin:.79in .31in .79in .31in;\nmso-header-margin:.51in;\nmso-footer-margin:.51in;\nmso-page-orientation:landscape;\nmso-horizontal-page-align:center;\n}\n-->\n</style>\n<!--[if gte mso 9]><xml>\n<x:ExcelWorkbook>\n<x:ExcelWorksheets>\n<x:ExcelWorksheet>\n<x:Name>生产进度日报表</x:Name>\n<x:WorksheetOptions>\n<x:DefaultRowHeight>285</x:DefaultRowHeight>\n<x:Print>\n<x:ValidPrinterInfo/>\n<x:Scale>100</x:Scale>\n<x:PaperSizeIndex>9</x:PaperSizeIndex>\n<x:HorizontalResolution>200</x:HorizontalResolution>\n<x:VerticalResolution>200</x:VerticalResolution>\n</x:Print>\n<x:Selected/>\n<x:Panes>\n<x:Pane>\n<x:Number>3</x:Number>\n<x:ActiveRow>0</x:ActiveRow>\n<x:ActiveCol>0</x:ActiveCol>\n</x:Pane>\n</x:Panes>\n</x:WorksheetOptions>\n</x:ExcelWorksheet>\n</x:ExcelWorkbook>\n</xml><![endif]-->\n</head>\n<body>"
            + document.getElementById("Panel3").innerHTML.replace(/<a [^>]*>/gi, "").replace(/<\/a>/gi, "");
            + "</body></html>";
    form2.submit();
}
</script>

</body>
</html>
